package com.edu.compile.constant;

/**
 * @author yanzhao
 * @date 2021/10/18 22:22
 * @since 1.0.0
 */
public enum ParamTypeEnum implements Comparator {

    STRING("String"),
    INT("Int"),
    LONG("Long"),
    FLOAT("Float"),
    DOUBLE("Double"),
    BOOLEAN("Boolean"),
//    STRING("String", new StringParser()),
//    INT("Int", new IntParser()),
//    LONG("Long", new LongParser()),
//    FLOAT("Float", new FloatParser()),
//    DOUBLE("Double", new DoubleParser()),
//    BOOLEAN("Boolean", new BooleanParser())
    ;

    ParamTypeEnum(String name) {
        this.name = name;
    }

    private String name;

    public String getName() {
        return name;
    }

//    public static <T> T convert(String name, Object value) {
//        ParamTypeEnum paramTypeEnum = Arrays.stream(ParamTypeEnum.values()).filter(t -> t.test(name)).findAny().orElse(STRING);
//        return (T) paramTypeEnum.parser.parse(value);
//    }

}
